<!DOCTYPE html>
<html lang="en">
  <head>
    <!-- Use correct character set. -->
    <meta charset="utf-8" />
    <!-- Tell IE to use the latest, best version. -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <!-- Make the application on mobile take up the full browser screen and disable user scaling. -->
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"
    />
    <title>Hello World!</title>
    <!-- <script src="../Build/Cesium/Cesium.js"></script> -->
    <script src="../Build/CesiumUnminified/Cesium.js"></script>
    <script src="jquery-2.0.3.js"></script>
    <style>
      @import url(../Build/Cesium/Widgets/widgets.css);

      html,
      body,
      #cesiumContainer {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        overflow: hidden;
      }
    </style>
  </head>

  <body>
    <div
      id="content"
      style="
        position: absolute;
        right: 0px;
        right: 0px;
        width: 300px;
        height: 200px;
      "
    ></div>
    <div id="cesiumContainer"></div>
    <script>
      //Create a Viewer instances and add the DataSource.
      // var viewer = new Cesium.Viewer("cesiumContainer", {
      //   //需要进行可视化的数据源的集合
      //   animation: false, //是否显示动画控件
      //   shouldAnimate: true,
      //   homeButton: false, //是否显示Home按钮
      //   fullscreenButton: false, //是否显示全屏按钮
      //   baseLayerPicker: false, //是否显示图层选择控件
      //   geocoder: false, //是否显示地名查找控件
      //   timeline: false, //是否显示时间线控件
      //   sceneModePicker: true, //是否显示投影方式控件
      //   navigationHelpButton: false, //是否显示帮助信息控件
      //   infoBox: false, //是否显示点击要素之后显示的信息
      //   requestRenderMode: true, //启用请求渲染模式
      //   scene3DOnly: false, //每个几何实例将只能以3D渲染以节省GPU内存
      //   sceneMode: 3, //初始场景模式 1 2D模式 2 2D循环模式 3 3D模式  Cesium.SceneMode
      //   fullscreenElement: document.body, //全屏时渲染的HTML元素 暂时没发现用处
      //   //天地图是官方开元的地图，不需要密钥
      //   imageryProvider: new Cesium.UrlTemplateImageryProvider({
      //     url:
      //       "http://mt1.google.cn/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}&s=Gali",
      //   }),
      // });

      var url =
        "http://124.71.198.233:6080/arcgis/rest/services/SZJO/JCSLDT/MapServer";
      // var esri = new Cesium.ArcGisMapServerImageryProvider({
      //   url: url
      // });
      // viewer.imageryLayers.addImageryProvider(esri)

      var cgs2000Ellipsolid = new Cesium.Ellipsoid(
        6378137.0,
        6378137.0,
        6356752.31414035585
      );

      var myGeographicTilingScheme = new Cesium.GeographicTilingScheme({
        ellipsoid: cgs2000Ellipsolid,
        rectangle: Cesium.Rectangle.fromDegrees(-180, -90, 180, 90),
        // ,
        // numberOfLevelZeroTilesX: 4,
        // numberOfLevelZeroTilesY: 2
      });
      var esriWMTS = new Cesium.ArcGisMapServerImageryProvider({
        url: url,
        // layer: 'jssl_vector_L3_L17',
        tilingScheme: myGeographicTilingScheme,
        rectangle: Cesium.Rectangle.fromDegrees(-180, -90, 180, 90),
        minimumLevel: 0,
        ellipsoid: cgs2000Ellipsolid,
        maximumLevel: 21,
      });

      var cgs2000GeographicProj = new Cesium.GeographicProjection(
        cgs2000Ellipsolid
      );
      var viewer = new Cesium.Viewer("cesiumContainer", {
        animation: false,
        geocoder: false,
        timeline: false,
        navigationHelpButton: false,
        baseLayerPicker: false,
        mapProjection: cgs2000GeographicProj,
        // imageryProvider: esriWMTS
        imageryProvider: new Cesium.UrlTemplateImageryProvider({
          url:
            "http://mt1.google.cn/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}&s=Gali",
        }),
      });

      viewer.imageryLayers.addImageryProvider(esriWMTS);

      viewer.camera.flyTo({
        destination: Cesium.Rectangle.fromDegrees(
          117.9797373130001,
          26.648601301000042,
          118.9541902090001,
          27.339142627000058
        ),
      });
    </script>
  </body>
</html>
